export class Defer<T = any> {
    public resolve: ((value?: T) => void) | undefined;
    public reject: ((value?: T) => void) | undefined;
    public resolved?: boolean = false;
    public promise: Promise<any>;
    constructor() {
        this.promise = new Promise((resolve, reject) => {
            this.resolve = resolve;
            this.reject = reject;
        })
    }
}